package com.ujs.commonutils.utils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangshihao
 * @create 2023-09-03 13:09
 */
public class PackageListPage {
    public static Map<String, Object> packageListPage(Page commentPage, QueryWrapper queryWrapper) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("items", commentPage.getRecords());
        map.put("current", commentPage.getCurrent());
        map.put("pages", commentPage.getPages());
        map.put("size", commentPage.getSize());
        map.put("total", commentPage.getTotal());
        map.put("hasNext", commentPage.hasNext());
        map.put("hasPrevious", commentPage.hasPrevious());
        return map;
    }
}
